package com.lxd.sunso.product.controller;


import com.lxd.sunso.common.utils.R;
import com.lxd.sunso.product.components.SmsComponent;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/sms")
public class SmsSendController {
    @Autowired
    SmsComponent smsComponent;

    @GetMapping("/sendMessage")
    public R sendMessage(@RequestParam("phone") String phone, @RequestParam("machineKind") String machineKind, @RequestParam("machineName") String machineName, @RequestParam("machineId") String machineId, @RequestParam("message") String message) {
        smsComponent.sendSmsCode(phone, machineKind, machineName, machineId, message);
        return R.ok();
    }
}
